import { Button, Form, Input } from "antd-mobile";
import { useNavigate } from "react-router-dom";
import React from "react";

function Index() {
  const why = useNavigate();
  const onFinish = (values) => {
    console.log(values);
    why("/list", { state: values });
  };
  return (
    <div>
      <Form
        onFinish={onFinish}
        footer={
          <Button block type="submit" color="primary" size="large">
            提交
          </Button>
        }
      >
        <div>
          <Form.Item label="出发地" name="start">
            <Input></Input>
          </Form.Item>
          <Form.Item label="目的地" name="end">
            <Input></Input>
          </Form.Item>
        </div>
      </Form>
    </div>
  );
}

export default Index;
